package com.winshare.saleAssistant.dao;

import com.winshare.saleAssistant.domain.entity.OrganizationDO;
import com.winshare.saleAssistant.domain.query.OrganizationQuery;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface OrganizationMapper {

    int saveOrganization(OrganizationDO organizationDO);

    List<OrganizationDO> findOrgListByConditions(OrganizationQuery organizationQuery);

    int queryOrganizationCount(OrganizationQuery organizationQuery);

    int countByOrgCodeOrOrgName(@Param("orgCode")String orgCode, @Param("orgName")String orgName,
                                @Param("orgId")Integer orgId);

    int updateOrganization(OrganizationDO organizationDO);

    int deleteOrganization(OrganizationDO organizationDO);

    OrganizationDO getOrganization(OrganizationDO organizationDO);

    List<Integer> getChildrenOrgIdList(@Param("orgIdList")List<Integer> orgIdList,@Param("orgType")String orgType);

    OrganizationDO findOrganization(@Param("orgCode")String orgCode, @Param("orgName")String orgName);
}
